package com.atguigu.lease.web.app.context;

import com.atguigu.lease.model.entity.UserInfo;

public class LoginUserContext {
    private static final ThreadLocal<UserInfo> userThreadLocal = new ThreadLocal<>();

    public static void setLoginUser(UserInfo userInfo) {
        System.out.println("标点9");
        userThreadLocal.set(userInfo);
    }

    public static UserInfo getLoginUser() {
        System.out.println("标点10");
        return userThreadLocal.get();
    }

    public static void clear() {
        userThreadLocal.remove();
    }
}
